package factory

import (
	"irisx/x/v"
	"irisx/x/u"
	"irisx/x/c"
)

type Og struct {}

// 生成组织
func (this *Og) Generate(p *v.CParam) []v.RName{
	var F = ""
	var B = ""
	if p.FirstWords != ""{
		F = p.FirstWords
	}
	if p.LastWords != ""{
		B = p.LastWords
	}
	var names []v.RName
	rn := v.RName{
		Tag: v.O,
	}
	for i:=0;i<p.Number;i++{
		rn.Name = u.CreateName(F,B,p.Length,c.WordLen,c.Word,c.OgLen,c.Og,int64(i))
		names = append(names,rn)
	}
	return names
}
